<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@include file="common/header.jsp"%>
 <div class="row">
  <div class="col-md-12 col-sm-12 col-xs-12">
    <div class="x_panel">
      <div class="x_title">
      	
        <h2>
APP 信息管理维护 ${devUser.devname} <i class="fa fa-user"></i> 
         <small>您可以通过搜索或者其他的筛选项对APP的信息进行修改、删除等管理操作。^_^</small></h2>
        <div class="clearfix"></div>
      </div>
      <div class="x_content">
        <br />
        <form action="${pageContext.request.contextPath }/devApp/appInfoList" method="post"
        id="demo-form2" data-parsley-validate class="form-horizontal form-label-left">
        	<input type="hidden" id="currentPage" name="currentPage" value="1" />
		<ul>
		 <li>
          <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="softwareName">软件名称<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
              <input type="text" id="softwareName" name="softwareName" value="${map.softwareName }" class="form-control col-md-7 col-xs-12">
            </div>
          </div>
          </li>
          <li>
           <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">APP状态<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
            	<select name="appStatus" class="form-control col-md-7 col-xs-12">
            		<option value="">-- 请选择 --</option>
            		<c:forEach items="${statusList }" var="status">
            			<option <c:if test="${map.status == status.valueid }">selected="selected"</c:if>  value="${status.valueid }" >${status.valuename }</option>
            		</c:forEach>
            	</select>
            </div>
          </div>
          </li>
          <li>
           <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">所属平台<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
            	<select name="appFlatform" class="form-control col-md-7 col-xs-12">
            		<option value="">-- 请选择 --</option>
            		<c:forEach items="${flatformList }" var="flatform">
            			<option <c:if test="${map.flatform == flatform.valueid }">selected="selected"</c:if> value="${flatform.valueid }">${flatform.valuename }</option>
            		</c:forEach>
            	</select>
            </div>
          </div>
          </li>
          <li>
           <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">一级分类<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
            	<select onchange="findLevel2(this)" name="appLevelOne" class="form-control col-md-7 col-xs-12">
            		<option value="">-- 请选择 --</option>
            		<c:forEach items="${levelOneList }" var="levelOne">
            			<option <c:if test="${map.levelOne == levelOne.id }">selected="selected"</c:if> value="${levelOne.id }">${levelOne.categoryname }</option>
            		</c:forEach>
            	</select>
            </div>
          </div>
          </li>
          <li>
           <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="appLevelTwo">二级分类<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
            	<select onchange="findLevel3(this)" id="appLevelTwo" name="appLevelTwo" class="form-control col-md-7 col-xs-12">
            		<option value="">-- 请选择 --</option>
            		<c:forEach items="${levelTwoList }" var="levelTwo">
            			<option <c:if test="${map.levelTwo == levelTwo.id }">selected="selected"</c:if> value="${levelTwo.id }">${levelTwo.categoryname }</option>
            		</c:forEach>
            	</select>
            </div>
          </div>
          </li>
          <li>
           <div class="form-group">
            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="first-name">三级分类<span class="required">*</span>
            </label>
            <div class="col-md-6 col-sm-6 col-xs-12">
            	<select id="appLevelThree" name="appLevelThree" class="form-control col-md-7 col-xs-12">
            		<option value="">-- 请选择 --</option>
            		<c:forEach items="${levelThreeList }" var="levelThree">
            			<option <c:if test="${map.levelThree == levelThree.id }">selected="selected"</c:if> value="${levelThree.id }">${levelThree.categoryname }</option>
            		</c:forEach>
            	</select>
            </div>
          </div>
          </li>
          
          <div class="ln_solid"></div>
          <div class="form-group">
            <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
              <input type="submit" class="btn btn-primary" value="查询" />
            </div>
          </div>
		</ul>
        </form>
      </div>
    </div>
  </div>
  <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2>APP商品展示 <small>${devUser.devname }</small></h2>
                    <div class="clearfix"></div>
                   	<a href="${pageContext.request.contextPath }/devApp/disAppInfoAdd" class="btn btn-info" type="button">新增APP基础信息</a>
                  </div>
                  <div class="x_content">
                    <table id="datatable" class="table table-striped table-bordered">
                      <thead>
                        <tr>
                          <th>软件名称</th>
                          <th>APK名称</th>
                          <th>软件大小(单位:M)</th>
                          <th>所属平台</th>
                          <th>所属分类(一级分类、二级分类、三级分类)</th>
                          <th>状态</th>
                          <th>下载次数</th>
                          <th>最新版本号</th>
                          <th style="width:125px">操作</th>
                        </tr>
                      </thead>
                      <tbody>
                      <c:forEach items="${pageBean.pageList }" var="appInfo">
                        <tr>
                          <td>${appInfo.softwarename }</td>
                          <td>${appInfo.apkname }</td>
                          <td>${appInfo.softwaresize }</td>
                          <td>${appInfo.flatformValueName }</td>
                          <td>${appInfo.level1Name }..${appInfo.level2Name }..${appInfo.level3Name }</td>
                          <td>${appInfo.statusValueName }</td>
                          <td>${appInfo.downloads }</td>
                          <td>${appInfo.versionNumber }</td>
                          <td>
							<div class="btn-group">
                     		  <button type="button" class="btn btn-danger">点击操作</button>
		                      <button type="button" class="btn btn-danger dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
		                        <span class="caret"></span>
		                        <span class="sr-only">Toggle Dropdown</span>
		                      </button>
		                      <ul class="dropdown-menu" role="menu">
		                        <li>
		                          <c:if test="${appInfo.status == 2 || appInfo.status == 5}">
		                        	<a href="#">上架</a>
		                          </c:if>
		                          <c:if test="${appInfo.status == 4}">
		                        	<a href="#">下架</a>
		                          </c:if>
		                        	<a href="#">新增版本</a>
		                        	<a href="#">修改版本</a>
		                        	<a onclick="appInfoUpdate(this)" appInfoId="${appInfo.id }" appInfoStatus="${appInfo.status}" href="javascript:;">修改</a>
		                        	<a href="#">查看</a>
		                        	<a href="#">删除</a>
		                        </li>
		                      </ul>
		                    </div>
						  </td>
                        </tr>
                      </c:forEach>
                      </tbody>
                    </table>
                  </div>
                </div>
              </div>
              <div class="row">
					<div class="col-sm-5">
						<div class="dataTables_info" id="datatable-responsive_info"
							role="status" aria-live="polite">共${pageBean.totalCount }条记录
							${pageBean.currentPage }/${pageBean.totalPage } 页</div>
					</div>
					<div class="col-sm-7">
						<div class="dataTables_paginate paging_simple_numbers"
							id="datatable-responsive_paginate">
							<ul class="pagination">
								<c:if test="${pageBean.currentPage > 1 }">
									<li class="paginate_button previous"><a
										href="javascript:page(1);"
										aria-controls="datatable-responsive" data-dt-idx="0"
										tabindex="0">首页</a>
									</li>
									<li class="paginate_button "><a
										href="javascript:page(${pageBean.currentPage } - 1);"
										aria-controls="datatable-responsive" data-dt-idx="1"
										tabindex="0">上一页</a>
									</li>
								</c:if>	
								<c:if test="${pageBean.currentPage < pageBean.totalPage }">
									<li class="paginate_button "><a
										href="javascript:page(${pageBean.currentPage } + 1);"
										aria-controls="datatable-responsive" data-dt-idx="1"
										tabindex="0">下一页</a>
									</li>
									<li class="paginate_button next"><a
										href="javascript:page(${pageBean.totalPage });"
										aria-controls="datatable-responsive" data-dt-idx="7"
										tabindex="0">最后一页</a>
									</li>
								</c:if>	
							</ul>
						</div>
					</div>
				</div>
</div>
<%@include file="common/footer.jsp"%>